<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
      xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head th:include="include :: header"></head>
<body class="hold-transition skin-blue sidebar-mini">
<section class="content">
    <div class="row" style="margin-top: 64px">
        <div class="col-xs-10 col-xs-offset-1" >
            <div class="box">
                <div class="box-header">
                    <table id="t1" class="t1" >
                        <thead style="display: table-header-group" >
                        <tr>
                            <td colspan="14">
                                <img th:src="@{/img/logo3.jpg}" width="64px" height="40px" style="margin-top: -30px">
                                <div style="display: inline-block;margin-top: 5px;margin-left: 20px">
                                    <span style="letter-spacing: 24px;display: block;line-height: 20px">&nbsp;辽宁忠旺机械设备制造有限公司</span>
                                    <span style="display: block;font-size: 12px;line-height: 20px">Liaoning Zhongwang Machinery Equipment Manufacturing Co., Ltd</span>
                                </div>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="14" style="font-size: 16px;letter-spacing: 4px;">
                                <span >制作件清单</span>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="2" style="width: 8%;">项目编号</td>
                            <td style="width: 10%;">
                                [[${serviceTaskModel.proCode}]]
                            </td>
                            <td style="width: 8%">项目名称</td>
                            <td colspan="3" style="width: 30%">
                                [[${serviceTaskModel.proName}]]
                            </td>
                            <td style="width: 8%">项目数量</td>
                            <td style="width: 6%">
                                [[${serviceTaskModel.proNum}]]
                            </td>
                            <td style="width: 6%">类型</td>
                            <td style="width: 9%">
                                [[${serviceTaskModel.name}]]
                            </td>
                            <td style="width: 6%">部分</td>
                            <td style="width: 9%">
                                [[${serviceTaskModel.part}]]
                            </td>
                        </tr>

                        </thead>
                        <tr>
                            <td style="width: 4%;">序号</td>
                            <td colspan="4">图号</td>
                            <td colspan="3">图名</td>
                            <td style="width: 8%">数量</td>
                            <td colspan="2">制作件类型</td>
                            <td colspan="3">备注</td>
                        </tr>
                        </thead>
                        <tbody>
                        <tr th:each="plan : ${makeResultList}">
                            <td th:text="${planStat.count}">1</td>
                            <td style="text-align:left;" colspan="4" th:text="${plan.drawNo}"></td>
                            <td colspan="3" th:text="${plan.drawName}"></td>
                            <td th:text="${plan.drawNum}"></td>
                            <td colspan="2" th:text="${plan.makeType}"></td>
                            <td colspan="3" th:text="${plan.remark}"></td>
                        </tr>
                        </tbody>

                    </table>

                </div>
                <div class="box-body">
                    <form id="queryForm" onsubmit="return false;">
                        <input type="hidden" id="makeSheetId" name="sheetId" th:value="${serviceTaskModel.id}">
                        <input type="hidden" id="makeSheetType" name="sheetType"
                               th:value="${serviceTaskModel.sheetType}">
                    </form>
                    <!--<button type="button" class="btn btn-success" id="btn-receive"-->
                            <!--onclick="selected()"  v-if="form.status === 1" shiro:hasPermission="tec:batchRecep:edit">-->
                        <!--<span class="Bold">接收</span>-->
                    <!--</button>-->
                    <table id="bootstrap-table"></table>
                </div>
            </div>
        </div>
    </div>
</section>
<input type="hidden" id="sheetType" th:value="${serviceTaskModel.sheetType}">
<div th:include="include :: footer"></div>
<script th:inline="javascript">

    let table, columns,
        sheetId = +$("#sheetId").val(),
        sheetType = +$("#sheetType").val();

    /** 选择计划提报类型 */
    function handlerPage() {
                columns = [
                    {
                        title: '序号', field: 'id', width: '50',
                        formatter: function (value, row, index) {
                            return index + 1;
                        }
                    },
                    {title: "图号", field: 'drawNo'},
                    {title: "零件名称", field: 'drawName'},
                    {title: "零件数量", field: 'drawNum'},
                    {title: "制作件类型", field: 'makeType'},
                    // { title: "变更标识", field: 'changeStatus',
                    //     formatter: function (value) {
                    //         if (value ==0) {
                    //             return '<span class="badge label-success">原始单</span>';
                    //         }else {
                    //             return '<span class="badge label-inverse">变更单</span>';
                    //         }
                    //     }},
                    {title: "备注", field: 'remark'}
                ];
    }

    $(function () {
        debugger;
        let  makeSheetId = [[${serviceTaskModel.id}]];

        // handlerPage();
        // /** 加载列表 */
        // table = js.table.init({
        //     url: ctx + "craft/receive/detail/result?makeSheetId="+makeSheetId,
        //     showExport: false,
        //     columns: columns
        // });


    });


</script>
</body>
</html>
